// var o;
// exports.EventConfig = exports.AssetsAction = exports.AssetsSource = void 0;
// var r;
// var a;
// var AL_GAME_HUA_Common = require("./AL_GAME_HUA_Common");
// var AL_GAME_HUA_CurrencyData = require("./AL_GAME_HUA_CurrencyData");
// var AL_GAME_HUA_GameData = require("./AL_GAME_HUA_GameData");
// var AL_GAME_HUA_PropConfig = require("./AL_GAME_HUA_PropConfig");
// var AL_GAME_HUA_ConfigHandler = require("./AL_GAME_HUA_ConfigHandler");
// var AL_GAME_HUA_GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");
// (a = exports.AssetsSource || (exports.AssetsSource = {})).game = "game";
// a.giftbox = "giftbox";
// a.starbox = "starbox";
// a.shop = "shop";
// a.coin = "coin";
// a.bank = "bank";
// a.onlineGift = "onlineGift";
// a.mission = "mission";
// a.login = "login";
// a.store = "store";
// a.welfare = "welfare";
// a.welfare_invite = "welfare_invite";
// a.welfare_club = "welfare_club";
// a.welfare_subs = "welfare_subs";
// (r = exports.AssetsAction || (exports.AssetsAction = {})).get = "get";
// r.video_get = "video_get";
// r.share_get = "share_get";
// r.coin_get = "coin_get";
// r.cost = "cost";
// r.pay = "pay";
// var d = (function (e) {
//     function t() {
//         var t = e.call(this) || this;
//         t.eventMap = {};
//         t.assetsMap = {};
//         t.init_assets();
//         return t;
//     }
//     __extends(t, e);
//     t.getInstance = function () {
//         return this.instance || (this.instance = new t());
//     };
//     t.prototype.destroy = function () {
//         t.instance = null;
//     };
//     t.prototype.jiazai_peizhi = function () {
//         var e = this;
//         return this.yibu_jiazai_txt_peizhi("Event").then(function (t) {
//             if (t) {
//                 for (var n = 0; n < t.length; n++) {
//                     e.eventMap[t[n].eventCode] = t[n].eventName;
//                 }
//             }
//         });
//     };
//     t.prototype.customEvent = function (e, t) {
//         if (e in this.eventMap) {
//             var n = t || this.eventMap[e];
//             if (ailin_sdk_manager.shezhiZidingyiShijian) {
//                 ailin_sdk_manager.shezhiZidingyiShijian(e, n);
//             }
//         } else {
//             if (ailin_sdk_manager.shezhiZidingyiShijian) {
//                 ailin_sdk_manager.shezhiZidingyiShijian(e, t);
//             }
//         }
//     };
//     t.prototype.init_assets = function () {
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.gold,
//             getRemain: function () {
//                 return AL_GAME_HUA_CurrencyData.CurrencyData.getInstance().getHave(
//                     AL_GAME_HUA_CurrencyData.CurrencyType.COIN
//                 );
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_magicStick,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(AL_GAME_HUA_PropConfig.PropId.TIPS_ENTER);
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_overtime,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(AL_GAME_HUA_PropConfig.PropId.TIME_ENTER);
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_doubleStar,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(AL_GAME_HUA_PropConfig.PropId.STAR_ENTER);
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_prompt,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(AL_GAME_HUA_PropConfig.PropId.TIPS_GAME);
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_brush,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(AL_GAME_HUA_PropConfig.PropId.CHANGE_GAME);
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_freeze,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(AL_GAME_HUA_PropConfig.PropId.TIME_GAME);
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_reset,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(AL_GAME_HUA_PropConfig.PropId.REFRESH_GAME);
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.revive,
//             getRemain: function () {
//                 return 0;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.level_locking,
//             getRemain: function () {
//                 return 0;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.level_empty,
//             getRemain: function () {
//                 return 0;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_1,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_2,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_3,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_4,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_5,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_6,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_7,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_8,
//             getRemain: function () {
//                 return 1;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.star,
//             getRemain: function () {
//                 return AL_GAME_HUA_GameData.GameData.getInstance().huoqu_xingxing_shuliang();
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.speedUp,
//             getRemain: function () {
//                 return 0;
//             }
//         });
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.vip,
//             getRemain: function () {
//                 return 0;
//             }
//         });
//     };
//     t.prototype.add_goods = function (e) {
//         if (e.goods in this.assetsMap == 0) {
//             this.assetsMap[e.goods] = e;
//         }
//     };
//     t.prototype.assetsReport = function (e, t) {
//         var n;
//         var o;
//         var i;
//         var r = t.level;
//         var a = t.goodsList;
//         var c = t.source;
//         var l = t.action;
//         var u = [];
//         var p = 0;
//         for (var d = a; p < d.length; p++) {
//             var h = d[p];
//             var _ = this.assetsMap[h.goods];
//             u.push({
//                 goods: AL_GAME_HUA_GoodsConfig.GoodsConfig.getInstance().huoqu_shangpin_leixing(h.goods),
//                 num: h.num,
//                 balance:
//                     null !==
//                         (i =
//                             null !==
//                                 (o =
//                                     null === (n = null == _ ? void 0 : _.getRemain) || void 0 === n
//                                         ? void 0
//                                         : n.call(_)) && void 0 !== o
//                                 ? o
//                                 : h.balance) && void 0 !== i
//                         ? i
//                         : 0
//             });
//         }
//         var P = {
//             eventType: e,
//             source: c,
//             action: l,
//             level: null != r ? r : AL_GAME_HUA_Common.Common.huoqu_dangqian_guanqia_moshi_dengji(),
//             content: u,
//             pattern: AL_GAME_HUA_Common.Common.huoqu_guanqia_moshi_zifuchuan()
//         };
//         if (ailin_sdk_manager.assetsReport) {
//             ailin_sdk_manager.assetsReport(P);
//         }
//         console.log(
//             "[资产打点]" + ("cost" == e ? "消耗" : "output" == e ? "产出" : "transform" == e ? "转换" : "未知") + ":",
//             JSON.stringify(P)
//         );
//     };
//     t.prototype.assetsReportOutput = function (e) {
//         this.assetsReport("output", e);
//     };
//     t.prototype.assetsReportCost = function (e) {
//         this.assetsReport("cost", e);
//     };
//     t.prototype.assetsReportTransform = function (e) {
//         this.assetsReport("transform", e);
//     };
//     t.instance = null;
//     return t;
// })(AL_GAME_HUA_ConfigHandler.ConfigHandler);
// exports.EventConfig = d;


// // 引入各模块
// const AL_GAME_HUA_Common = require("./AL_GAME_HUA_Common");
// const AL_GAME_HUA_CurrencyData = require("./AL_GAME_HUA_CurrencyData");
// const AL_GAME_HUA_GameData = require("./AL_GAME_HUA_GameData");
// const AL_GAME_HUA_PropConfig = require("./AL_GAME_HUA_PropConfig");
// const AL_GAME_HUA_ConfigHandler = require("./AL_GAME_HUA_ConfigHandler");
// const AL_GAME_HUA_GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");

// /** 资源来源类型枚举 */
// exports.AssetsSource = {
//     game: "game",
//     giftbox: "giftbox",
//     starbox: "starbox",
//     shop: "shop",
//     coin: "coin",
//     bank: "bank",
//     onlineGift: "onlineGift",
//     mission: "mission",
//     login: "login",
//     store: "store",
//     welfare: "welfare",
//     welfare_invite: "welfare_invite",
//     welfare_club: "welfare_club",
//     welfare_subs: "welfare_subs"
// };

// /** 资源操作类型枚举 */
// exports.AssetsAction = {
//     get: "get",
//     video_get: "video_get",
//     share_get: "share_get",
//     coin_get: "coin_get",
//     cost: "cost",
//     pay: "pay"
// };

// /** 事件配置类 */
// class EventConfig extends AL_GAME_HUA_ConfigHandler.ConfigHandler {
//     static instance = null;

//     constructor() {
//         super();
//         this.eventMap = {};
//         this.assetsMap = {};
//         this.init_assets();
//     }

//     static getInstance() {
//         if (!this.instance) {
//             this.instance = new EventConfig();
//         }
//         return this.instance;
//     }

//     destroy() {
//         EventConfig.instance = null;
//     }

//     jiazai_peizhi() {
//         return this.yibu_jiazai_txt_peizhi("Event").then(configData => {
//             if (configData) {
//                 configData.forEach(config => {
//                     this.eventMap[config.eventCode] = config.eventName;
//                 });
//             }
//         });
//     }

//     customEvent(eventCode, eventName) {
//         const customEventName = eventName || this.eventMap[eventCode];
//         if (ailin_sdk_manager.shezhiZidingyiShijian) {
//             ailin_sdk_manager.shezhiZidingyiShijian(eventCode, customEventName);
//         }
//     }

//     init_assets() {
//         const goodsConfig = AL_GAME_HUA_GoodsConfig;
        
//         const addGoodsConfigurations = [
//             { goods: goodsConfig.GoodsId.gold, functionName: 'getHave', params: AL_GAME_HUA_CurrencyData.CurrencyType.COIN },
//             { goods: goodsConfig.GoodsId.prop_magicStick, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIPS_ENTER },
//             { goods: goodsConfig.GoodsId.prop_overtime, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIME_ENTER },
//             { goods: goodsConfig.GoodsId.prop_doubleStar, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.STAR_ENTER },
//             { goods: goodsConfig.GoodsId.prop_prompt, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIPS_GAME },
//             { goods: goodsConfig.GoodsId.prop_brush, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.CHANGE_GAME },
//             { goods: goodsConfig.GoodsId.prop_freeze, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIME_GAME },
//             { goods: goodsConfig.GoodsId.prop_reset, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.REFRESH_GAME },
//             { goods: goodsConfig.GoodsId.revive, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.level_locking, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.level_empty, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_1, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_2, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_3, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_4, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_5, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_6, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_7, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.shop_8, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.star, functionName: 'huoqu_xingxing_shuliang', params: null },
//             { goods: goodsConfig.GoodsId.speedUp, functionName: null, params: null },
//             { goods: goodsConfig.GoodsId.vip, functionName: null, params: null }
//         ];

//         addGoodsConfigurations.forEach(config => {
//             this.add_goods({
//                 goods: config.goods,
//                 getRemain: config.functionName ? () => AL_GAME_HUA_GameData.GameData.getInstance()[config.functionName](config.params) : () => 0
//             });
//         });
//     }

//     add_goods(item) {
//         if (!(item.goods in this.assetsMap)) {
//             this.assetsMap[item.goods] = item;
//         }
//     }

//     assetsReport(eventType, reportData) {
//         const { level, goodsList, source, action } = reportData;
//         const content = goodsList.map(goodsItem => {
//             const asset = this.assetsMap[goodsItem.goods];
//             const balance =
//                 asset?.getRemain?.() ?? goodsItem.balance ?? 0;

//             return {
//                 goods: AL_GAME_HUA_GoodsConfig.GoodsConfig.getInstance().huoqu_shangpin_leixing(goodsItem.goods),
//                 num: goodsItem.num,
//                 balance: balance
//             };
//         });

//         const reportPayload = {
//             eventType,
//             source,
//             action,
//             level: level ?? AL_GAME_HUA_Common.Common.huoqu_dangqian_guanqia_moshi_dengji(),
//             content,
//             pattern: AL_GAME_HUA_Common.Common.huoqu_guanqia_moshi_zifuchuan()
//         };

//         if (ailin_sdk_manager.assetsReport) {
//             ailin_sdk_manager.assetsReport(reportPayload);
//         }

//         console.log(
//             "[资产打点]" +
//             (eventType === "cost" ? "消耗" : eventType === "output" ? "产出" :
//             eventType === "transform" ? "转换" : "未知") + ":", 
//             JSON.stringify(reportPayload)
//         );
//     }

//     assetsReportOutput(reportData) {
//         this.assetsReport("output", reportData);
//     }

//     assetsReportCost(reportData) {
//         this.assetsReport("cost", reportData);
//     }

//     assetsReportTransform(reportData) {
//         this.assetsReport("transform", reportData);
//     }
// }

// // 导出事件配置
// exports.EventConfig = EventConfig;

// 引入各模块
const AL_GAME_HUA_Common = require("./AL_GAME_HUA_Common");
const AL_GAME_HUA_CurrencyData = require("./AL_GAME_HUA_CurrencyData");
const AL_GAME_HUA_GameData = require("./AL_GAME_HUA_GameData");
const AL_GAME_HUA_PropConfig = require("./AL_GAME_HUA_PropConfig");
const AL_GAME_HUA_ConfigHandler = require("./AL_GAME_HUA_ConfigHandler");
const AL_GAME_HUA_GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");

/** 资源来源类型枚举 */
exports.AssetsSource = {
    game: "game",
    giftbox: "giftbox",
    starbox: "starbox",
    shop: "shop",
    coin: "coin",
    bank: "bank",
    onlineGift: "onlineGift",
    mission: "mission",
    login: "login",
    store: "store",
    welfare: "welfare",
    welfare_invite: "welfare_invite",
    welfare_club: "welfare_club",
    welfare_subs: "welfare_subs"
};

/** 资源操作类型枚举 */
exports.AssetsAction = {
    get: "get",
    video_get: "video_get",
    share_get: "share_get",
    coin_get: "coin_get",
    cost: "cost",
    pay: "pay"
};

/** 事件配置类 */
class EventConfig extends AL_GAME_HUA_ConfigHandler.ConfigHandler {
    static instance = null;

    constructor() {
        super();
        this.eventMap = {};
        this.assetsMap = {};
        this.init_assets();
    }

    static getInstance() {
        if (!this.instance) {
            this.instance = new EventConfig();
        }
        return this.instance;
    }

    destroy() {
        EventConfig.instance = null;
    }

    jiazai_peizhi() {
        return this.yibu_jiazai_txt_peizhi("Event").then(configData => {
            if (configData) {
                configData.forEach(config => {
                    this.eventMap[config.eventCode] = config.eventName;
                });
            }
        });
    }

    customEvent(eventCode, eventName) {
        const customEventName = eventName || this.eventMap[eventCode];
        if (ailin_sdk_manager.shezhiZidingyiShijian) {
            ailin_sdk_manager.shezhiZidingyiShijian(eventCode, customEventName);
        }
    }

    init_assets() {
        const goodsConfig = AL_GAME_HUA_GoodsConfig;
        
        const addGoodsConfigurations = [
            { goods: goodsConfig.GoodsId.gold, functionName: 'getHave', params: AL_GAME_HUA_CurrencyData.CurrencyType.COIN },
            { goods: goodsConfig.GoodsId.prop_magicStick, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIPS_ENTER },
            { goods: goodsConfig.GoodsId.prop_overtime, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIME_ENTER },
            { goods: goodsConfig.GoodsId.prop_doubleStar, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.STAR_ENTER },
            { goods: goodsConfig.GoodsId.prop_prompt, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIPS_GAME },
            { goods: goodsConfig.GoodsId.prop_brush, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.CHANGE_GAME },
            { goods: goodsConfig.GoodsId.prop_freeze, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.TIME_GAME },
            { goods: goodsConfig.GoodsId.prop_reset, functionName: 'huoqu_prop_shuliang', params: AL_GAME_HUA_PropConfig.PropId.REFRESH_GAME },
            { goods: goodsConfig.GoodsId.revive, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.level_locking, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.level_empty, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_1, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_2, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_3, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_4, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_5, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_6, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_7, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.shop_8, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.star, functionName: 'huoqu_xingxing_shuliang', params: null },
            { goods: goodsConfig.GoodsId.speedUp, functionName: null, params: null },
            { goods: goodsConfig.GoodsId.vip, functionName: null, params: null }
        ];

        addGoodsConfigurations.forEach(config => {
            this.add_goods({
                goods: config.goods,
                getRemain: config.functionName ? () => AL_GAME_HUA_GameData.GameData.getInstance()[config.functionName](config.params) : () => 0
            });
        });
    }

    add_goods(item) {
        if (!(item.goods in this.assetsMap)) {
            this.assetsMap[item.goods] = item;
        }
    }

    assetsReport(eventType, reportData) {
        // const { level, goodsList, source, action } = reportData;
        // const content = goodsList.map(goodsItem => {
        //     const asset = this.assetsMap[goodsItem.goods];
        //     const balance =
        //         asset?.getRemain?.() ?? goodsItem.balance ?? 0;

        //     return {
        //         goods: AL_GAME_HUA_GoodsConfig.GoodsConfig.getInstance().huoqu_shangpin_leixing(goodsItem.goods),
        //         num: goodsItem.num,
        //         balance: balance
        //     };
        // });

        // const reportPayload = {
        //     eventType,
        //     source,
        //     action,
        //     level: level ?? AL_GAME_HUA_Common.Common.huoqu_dangqian_guanqia_moshi_dengji(),
        //     content,
        //     pattern: AL_GAME_HUA_Common.Common.huoqu_guanqia_moshi_zifuchuan()
        // };

        // if (ailin_sdk_manager.assetsReport) {
        //     ailin_sdk_manager.assetsReport(reportPayload);
        // }

        // console.log(
        //     "[资产打点]" +
        //     (eventType === "cost" ? "消耗" : eventType === "output" ? "产出" :
        //     eventType === "transform" ? "转换" : "未知") + ":", 
        //     JSON.stringify(reportPayload)
        // );
    }

    assetsReportOutput(reportData) {
        this.assetsReport("output", reportData);
    }

    assetsReportCost(reportData) {
        this.assetsReport("cost", reportData);
    }

    assetsReportTransform(reportData) {
        this.assetsReport("transform", reportData);
    }
}

// 导出事件配置
exports.EventConfig = EventConfig;




// let instance;
// exports.EventConfig = exports.AssetsAction = exports.AssetsSource = void 0;

// const AL_GAME_HUA_Common = require("./AL_GAME_HUA_Common");
// const AL_GAME_HUA_CurrencyData = require("./AL_GAME_HUA_CurrencyData");
// const AL_GAME_HUA_GameData = require("./AL_GAME_HUA_GameData");
// const AL_GAME_HUA_PropConfig = require("./AL_GAME_HUA_PropConfig");
// const AL_GAME_HUA_ConfigHandler = require("./AL_GAME_HUA_ConfigHandler");
// const AL_GAME_HUA_GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");

// /** 资源来源枚举 */
// const AssetsSource = (exports.AssetsSource = {
//     game: "game",
//     giftbox: "giftbox",
//     starbox: "starbox",
//     shop: "shop",
//     coin: "coin",
//     bank: "bank",
//     onlineGift: "onlineGift",
//     mission: "mission",
//     login: "login",
//     store: "store",
//     welfare: "welfare",
//     welfare_invite: "welfare_invite",
//     welfare_club: "welfare_club",
//     welfare_subs: "welfare_subs"
// });

// /** 资源操作枚举 */
// const AssetsAction = (exports.AssetsAction = {
//     get: "get",
//     video_get: "video_get",
//     share_get: "share_get",
//     coin_get: "coin_get",
//     cost: "cost",
//     pay: "pay"
// });

// /** 事件配置类 */
// class EventConfig extends AL_GAME_HUA_ConfigHandler.ConfigHandler {
//     constructor() {
//         super();
//         this.eventMap = {};
//         this.assetsMap = {};
//         this.init_assets();
//     }

//     /** 获取单例实例 */
//     static getInstance() {
//         if (!instance) {
//             instance = new EventConfig();
//         }
//         return instance;
//     }

//     /** 销毁单例实例 */
//     destroy() {
//         instance = null;
//     }

//     /** 加载配置 */
//     async jiazai_peizhi() {
//         const configData = await this.yibu_jiazai_txt_peizhi("Event");
//         if (configData) {
//             configData.forEach(item => {
//                 this.eventMap[item.eventCode] = item.eventName;
//             });
//         }
//     }

//     /**
//      * 自定义事件
//      * @param {string} eventCode - 事件码
//      * @param {string} eventName - 事件名称
//      */
//     customEvent(eventCode, eventName) {
//         const name = eventName || this.eventMap[eventCode];
//         if (ailin_sdk_manager.shezhiZidingyiShijian) {
//             ailin_sdk_manager.shezhiZidingyiShijian(eventCode, name);
//         }
//     }

//     /** 初始化资产 */
//     init_assets() {
//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.gold,
//             getRemain: () =>
//                 AL_GAME_HUA_CurrencyData.CurrencyData.getInstance().getHave(
//                     AL_GAME_HUA_CurrencyData.CurrencyType.COIN
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_magicStick,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(
//                     AL_GAME_HUA_PropConfig.PropId.TIPS_ENTER
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_overtime,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(
//                     AL_GAME_HUA_PropConfig.PropId.TIME_ENTER
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_doubleStar,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(
//                     AL_GAME_HUA_PropConfig.PropId.STAR_ENTER
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_prompt,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(
//                     AL_GAME_HUA_PropConfig.PropId.TIPS_GAME
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_brush,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(
//                     AL_GAME_HUA_PropConfig.PropId.CHANGE_GAME
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_freeze,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(
//                     AL_GAME_HUA_PropConfig.PropId.TIME_GAME
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.prop_reset,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_prop_shuliang(
//                     AL_GAME_HUA_PropConfig.PropId.REFRESH_GAME
//                 )
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.revive,
//             getRemain: () => 0
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.level_locking,
//             getRemain: () => 0
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.level_empty,
//             getRemain: () => 0
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_1,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_2,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_3,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_4,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_5,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_6,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_7,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.shop_8,
//             getRemain: () => 1
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.star,
//             getRemain: () =>
//                 AL_GAME_HUA_GameData.GameData.getInstance().huoqu_xingxing_shuliang()
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.speedUp,
//             getRemain: () => 0
//         });

//         this.add_goods({
//             goods: AL_GAME_HUA_GoodsConfig.GoodsId.vip,
//             getRemain: () => 0
//         });
//     }

//     /**
//      * 添加商品
//      * @param {object} item - 商品项
//      */
//     add_goods(item) {
//         if (!(item.goods in this.assetsMap)) {
//             this.assetsMap[item.goods] = item;
//         }
//     }

//     /**
//      * 资产报告
//      * @param {string} eventType - 事件类型
//      * @param {object} data - 数据
//      */
//     assetsReport(eventType, data) {
//         const { level, goodsList, source, action } = data;
//         const content = goodsList.map(goodsItem => {
//             const asset = this.assetsMap[goodsItem.goods];
//             const balance = asset?.getRemain?.() ?? goodsItem.balance ?? 0;
//             return {
//                 goods: AL_GAME_HUA_GoodsConfig.GoodsConfig.getInstance().huoqu_shangpin_leixing(goodsItem.goods),
//                 num: goodsItem.num,
//                 balance: balance
//             };
//         });

//         const reportData = {
//             eventType,
//             source,
//             action,
//             level: level ?? AL_GAME_HUA_Common.Common.huoqu_dangqian_guanqia_moshi_dengji(),
//             content,
//             pattern: AL_GAME_HUA_Common.Common.huoqu_guanqia_moshi_zifuchuan()
//         };

//         if (ailin_sdk_manager.assetsReport) {
//             ailin_sdk_manager.assetsReport(reportData);
//         }

//         const eventTypeDesc = {
//             cost: "消耗",
//             output: "产出",
//             transform: "转换"
//         }[eventType] || "未知";

//         console.log(`[资产打点]${eventTypeDesc}:`, JSON.stringify(reportData));
//     }

//     /**
//      * 资产报告 - 产出
//      * @param {object} data - 数据
//      */
//     assetsReportOutput(data) {
//         this.assetsReport("output", data);
//     }

//     /**
//      * 资产报告 - 消耗
//      * @param {object} data - 数据
//      */
//     assetsReportCost(data) {
//         this.assetsReport("cost", data);
//     }

//     /**
//      * 资产报告 - 转换
//      * @param {object} data - 数据
//      */
//     assetsReportTransform(data) {
//         this.assetsReport("transform", data);
//     }
// }

// exports.EventConfig = EventConfig;
